gdk: Allow calling gdk_cairo_surface_create_from_pixbuf with scale 0
authorKalev Lember <kalevlember@gmail.com>
Mon, 6 Oct 2014 12:19:21 +0000 (14:19 +0200)
committerKalev Lember <kalevlember@gmail.com>
Mon, 6 Oct 2014 12:39:22 +0000 (14:39 +0200)
The documentation explicitly states that 0 is an allowed value for using
the same scale as the window. This 0 value is also explicitly checked
down in the call chain and handled.

gdk/gdkcairo.c

index c54121599cfcc32386360134338f86e311fccf57..a36339445846de5e1776543358377413646d15ba 100644 (file)
@@ -285,7 +285,7 @@ gdk_cairo_surface_create_from_pixbuf (const GdkPixbuf *pixbuf,
   cairo_surface_t *surface;
 
   g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
-  g_return_val_if_fail (scale > 0, NULL);
+  g_return_val_if_fail (scale >= 0, NULL);
   g_return_val_if_fail (for_window == NULL || GDK_IS_WINDOW (for_window), NULL);
 
   if (gdk_pixbuf_get_n_channels (pixbuf) == 3)